﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TeamArchitect.PowerTools.Ultimate.Features;
using Microsoft.VisualStudio.TemplateWizard;
using EnvDTE;

namespace YasharEl.Infrastructure.ArchitectureTools.AppModelerLib.Wizards
{
    public class BasicWizardTemplateExtension : StandardFeatureTemplateExtension
    {
        public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);

            if (replacementsDictionary != null)
            {
                if (!replacementsDictionary.ContainsKey("$safesolutionname$"))
                {
                    replacementsDictionary.Add("$safesolutionname$", Solution.Name);
                }
            }

            if (replacementsDictionary != null)
            {
                GlobalReplacementsDictionary = new Dictionary<string, string>();
                foreach (var item in replacementsDictionary)
                {
                    GlobalReplacementsDictionary.Add(item.Key, item.Value);
                }
            }
        }

        public static Dictionary<string, string> GlobalReplacementsDictionary;
    }
}
